#pragma once

#include <string>
#include <map>
#include <WinSock2.h>

struct HookFunc
{
	void* m_old_func;
	void* m_new_func;

	HookFunc()
		:m_old_func(nullptr)
		,m_new_func(nullptr)
	{
	}
};

typedef std::map<std::string, HookFunc> HookFuncInfoMap;
class CDetourHookFunctionCtrl
{
public:
	CDetourHookFunctionCtrl();
	~CDetourHookFunctionCtrl();

	void AddHookFunc(const std::string& func_name, FARPROC hook_func);
	void InitHook();
	void UninitHook();

	FARPROC GetSystemFunc(const std::string& func_name);
private:
	HookFuncInfoMap m_hook_func_info;
	HMODULE m_hModule;
};